
<button>获取最新电影</button>

<ul>
    <li></li>
</ul>
<script src="./ajax3.js"></script>

<script>


    let iptObj = document.querySelector('button')

    iptObj.onclick = function() {

        get(
            'https://m.maizuo.com/gateway', 
            `cityId=310100&pageNum=1&pageSize=10&type=1&k=2907579`,
            res => {

                document.querySelector('ul').innerText = ''
    
                res.data.films.forEach(item => {
                    let liObj = document.createElement('li')
                    liObj.innerHTML = `<img src="${item.poster}" /> ${item.name} `
                    document.querySelector('ul').appendChild(liObj)
                })
            },
         headers={
        'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.2.0","e":"16418052151816917195096065","bc":"310100"}',
        'X-Host': 'mall.film-ticket.film.list',
        'X-Requested-Witht': 'XMLHttpRequest',
        'X-Token': 'undefined'},
        )
    }


</script>


    

